<?php

use think\facade\Route;


Route::miss(function () {
    return '404 Not Found!';
});

Route::group('api', function () {
    // 讯飞星火
    Route::get('Xunfei','Xunfei/index');


    // 注册登录
    Route::group('Login', function () {
        // 获取验证码
        Route::post('sendSmsCode', 'Login/sendSmsCode');
        // 注册
        Route::post('register', 'Login/register');
        // 登录
        Route::post('login', 'Login/login');
        // 验证码登录
        Route::post('codeLogin', 'Login/codeLogin');
    });
    // 找回密码
    Route::post('modifyPassword', 'Login/modifyPassword');


    // 主页列表
    Route::group('indexList',function (){
        // 显示简历详细信息企业，个人显示公司详细信息
        Route::post('releasePositionDetail', 'index/releasePositionDetail');
        // 显示职位招聘个人用户显示岗位，企业用户显示人才
        Route::get('releasePosition', 'index/releasePosition');
    })->middleware(\app\api\middleware\CheckToken::class);

    // 简历
    Route::group('Notes',function (){
        // 查看个人简历
        Route::post('manageNotes','Notes/manageNotes');
        // 删除简历
        Route::post('delNotes', 'Notes/delNotes');
        // 添加简历
        Route::post('addNotes', 'Notes/addNotes');
        // 修改简历
        Route::post('editNotes', 'Notes/editNotes');
    })->middleware(\app\api\middleware\CheckToken::class);

    // 报名（培训）
    Route::group('Train',function (){
        // 课程列表
        Route::get('TrainList','Train/TrainList');
        // 参加报名
        Route::post('TrainApply', 'Train/TrainApply');
        // 查看课程详细信息
        Route::get('TrainDetail', 'Train/TrainDetail');
    })->middleware(\app\api\middleware\CheckToken::class);

    // 留言
    Route::post('message', 'Message/message')->middleware(\app\api\middleware\CheckToken::class);

    // 主页
    Route::group('index', function () {
        // 导航列表
        Route::get('nav', 'index/nav');
        // 轮播图
        Route::get('banner', 'index/banner');
        // 显示职位选择
        Route::get('getPosition', 'index/getPosition');
    })->middleware(\app\api\middleware\CheckToken::class);

    // 人才政策
    Route::group('TalentPolicy',function (){
        // 获取人才政策列表
        Route::get('talentPolicyList', 'TalentPolicy/talentPolicyList');
        // 获取人才政策详细
        Route::post('talentPolicyDetail', 'TalentPolicy/talentPolicyDetail');
    })->middleware(\app\api\middleware\CheckToken::class);

    // 劳动关系
    Route::group('Law', function () {
        Route::get('LawFirmList', 'LawFirm/LawFirmList');
        Route::post('LawFirmDetail', 'LawFirm/LawFirmDetail');
    })->middleware(\app\api\middleware\CheckToken::class);

    // 教育经历
    Route::group('educational',function (){
        // 查看教育经历
        Route::get('educationalList', 'Educational/educationalList');
        // 添加教育经历
        Route::post('addEducational', 'Educational/addEducational');
        // 修改教育经历
        Route::post('educationalEdit', 'Educational/educationalEdit');
        // 显示单个教育经历详细
        Route::post('educationalDetail', 'Educational/educationalDetail');
    })->middleware(\app\api\middleware\CheckToken::class);

    // 工作经历
    Route::group('work',function (){
        // 删除工作经历
        Route::post('deleteWork','work/deleteWork');
        // 查看工作经历
        Route::get('workList', 'work/getWorkList');
        // 添加工作经历
        Route::post('addWork', 'work/addWork');
        // 查看单个工作经历详细
        Route::post('detailWork','work/detailWork');
    })->middleware(\app\api\middleware\CheckToken::class);

    // 查看投递
    Route::group('Delivered',function (){
        // 企业用户看投过的简历
        Route::get('Delivered', 'Delivered/Delivered');
        // 个人用户查看投递过的公司
        Route::get('DeliveredNotes','Delivered/DeliveredNotes');
    })->middleware(\app\api\middleware\CheckToken::class);

    // 获取类型
    Route::group('type',function (){
        // 获取用户类型
        Route::post('type', 'type/type');
        // 登录后选择用户类型
        Route::post('typeAdd', 'type/typeAdd');
    })->middleware(\app\api\middleware\CheckToken::class);

    // 用户
    Route::group('user', function () {
        // 上传头像
        Route::post('head', 'user/head');
        // 搜索
        Route::get('search', 'index/search');
        // 修改个人信息
        Route::post('userEdit', 'user/userEdit');
        // 获取个人信息
        Route::get('user', 'user/user');
    })->middleware(\app\api\middleware\CheckToken::class);

    // 企业用户发布职位
    Route::group('releasePosition', function (){
        Route::post('releasePosition','releasePosition/releasePosition');
    })->middleware(\app\api\middleware\CheckToken::class);


});
